Interactive Web Pages - Events Demonstration

preventDefault()

Please enter your name and click Submit to view the concept the preventDefault() method.

The preventDefault method stops a typical action from happening. In the case of a form, a submission is prevented. In another case, such as with a link, the default action of navigating to the link's location is what would be prevented.